home *** CD-ROM | disk | FTP | other *** search
/ Champak 99 / (Vol 99) Jan 19 2010.iso / Games / Naruto / tracker.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2010-01-19  |  2.6 KB  |  85 lines

  1. function onMetricsLoaded()
  2. {
  3.    var _loc2_ = g_path.lastIndexOf("/",g_path.length);
  4.    var _loc3_ = g_path.substring(0,_loc2_);
  5.    g_path = _loc3_;
  6.    var _loc6_ = g_path.lastIndexOf("/",g_path.length);
  7.    var _loc4_ = g_path.substring(_loc6_ + 1,_loc2_);
  8.    _loc2_ = _loc6_;
  9.    _loc3_ = g_path.substring(0,_loc2_);
  10.    g_path = _loc3_;
  11.    _loc6_ = g_path.lastIndexOf("/",g_path.length);
  12.    var _loc5_ = g_path.substring(_loc6_ + 1,_loc2_);
  13.    messageString = _loc5_ + "_" + _loc4_ + "_";
  14.    switch(productionGame)
  15.    {
  16.       case 1:
  17.          _metrics.account = "carnetnmcom";
  18.          break;
  19.       case 2:
  20.          _metrics.account = "carnetnmdev";
  21.          omnitureGraphic._x = 0;
  22.          omnitureGraphic._y = 0;
  23.          break;
  24.       default:
  25.          _metrics.account = "carnetnmdev";
  26.    }
  27.    _metrics.nameSpace = "cartoonnetworknewmedia";
  28.    _metrics.CName = "stats.cartoonnetwork.com";
  29.    _metrics.pageURL = "http://www.cartoonnetwork.com/video/gen/test.html";
  30.    _metrics.clickMapSupport = true;
  31.    _metrics.movieID = _loc4_;
  32.    _metrics.clickMapPage = "My Page Name";
  33.    _metrics.testSupport = true;
  34.    _metrics.debugActive = true;
  35.    _metrics.autoTrack = false;
  36.    _metrics.analyticsDelay = true;
  37.    _metrics.delayControl = 2;
  38.    if(productionGame)
  39.    {
  40.       _metrics.sendLink("Games",{objectid:this,channel:"Games",prop4:messageString + "play"});
  41.    }
  42.    trace("Metrics Loaded");
  43. }
  44. var g_path;
  45. var messageString = "";
  46. var connection = new LocalConnection();
  47. var productionGame = 0;
  48. var asMetricsString = "as_metrics.swf";
  49. g_path = this._url;
  50. trace("g_path:   " + g_path);
  51. if(g_path.lastIndexOf("www.cartoonnetwork",g_path.length))
  52. {
  53.    if(g_path.lastIndexOf("cartoonnetwork.com/",g_path.length))
  54.    {
  55.       productionGame = 1;
  56.    }
  57. }
  58. if(g_path.lastIndexOf(".turner.com",g_path.length) >= 0 || g_path.lastIndexOf("http:",g_path.length) == -1)
  59. {
  60.    productionGame = 2;
  61. }
  62. if(productionGame == 1 || g_path.lastIndexOf(".turner.com",g_path.length) >= 0)
  63. {
  64.    trace("productionGame:  " + productionGame + ",  " + g_path.lastIndexOf(".turner.com",g_path.length));
  65.    asMetricsString = "/tools/media/as_metrics.swf";
  66. }
  67. _metrics.addEventListener("loaded",this,"onMetricsLoaded");
  68. _metrics.loadEvents(asMetricsString);
  69. connection.sendTracking = function(param1, param2, param3)
  70. {
  71.    var _loc2_ = messageString + param1;
  72.    trace("Trk_Received: " + _loc2_);
  73.    if(productionGame)
  74.    {
  75.       _metrics.sendLink("Games",{objectid:this,channel:"Games",prop4:_loc2_});
  76.    }
  77. };
  78. connection.testConnection = function()
  79. {
  80.    trace("### Test_Received ###");
  81. };
  82. connection.connect("trkConnection");
  83. trace(" -- Tracker Loaded -- ");
  84. stop();
  85.